package edu.sctu.java.advanced.filter;

public class Client {

    public static void main(String[] args) {

        Request request = new Request();
        request.param = "hello";

        Response response = new Response();

        /**
         * 基本设计思想：request和response穿梭于各个Filter即同一个对象会被各个Filter所处理，
         * 每个Filter在处理的时候不需要返回值，而是通过chain继续向后传递。
         */
        FilterChain chain = new FilterChain();
        chain.addFilter(new MyFilter());
        chain.addFilter(new HtmlFilter());
        chain.doInternalFilter(request, response);

        System.out.println(request.param);
    }
}
